package com.tanhua.admin.controller;

import com.tanhua.admin.service.DashboardService;
import com.tanhua.model.vo.AnalysisGraphVo;
import com.tanhua.model.vo.AnalysisSummaryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/dashboard")
public class DashboardController {

    @Autowired
    private DashboardService dashboardService;

    @GetMapping("/summary")
    public AnalysisSummaryVo displaySummary(){
        AnalysisSummaryVo analysisSummaryVo = dashboardService.getSummary();
        return analysisSummaryVo;
    }

    @GetMapping("/users")
    public AnalysisGraphVo displayGraph(Long sd,Long ed,Integer type){
        AnalysisGraphVo analysisGraphVo = dashboardService.displayGraph(sd,ed,type);
        return analysisGraphVo;
    }



}
